/********************************************************************
* Copyright (c) 2013,TGS,All rights reserved.
* fileName:	MapToolZoom.h	
* created:	2013/04/26 17:01

* version:	1.6
* detail: 
*********************************************************************/

#include "MapTool.h"
#include <QRect>



namespace TGS{
namespace MapControl{

class RubberBand;


/** \ingroup gui
 * A map tool for zooming into the map.
 * @see MapTool
 */
class MapToolZoom : public MapTool
{
  public:
    //! constructor
    MapToolZoom( MapCanvas* canvas, bool zoomOut );

    ~MapToolZoom();

    //! Overridden mouse move event
    virtual void canvasMoveEvent( QMouseEvent * e );

    //! Overridden mouse press event
    virtual void canvasPressEvent( QMouseEvent * e );

    //! Overridden mouse release event
    virtual void canvasReleaseEvent( QMouseEvent * e );

    virtual bool isTransient() { return true; }

    virtual void deactivate();

  protected:
    //! stores actual zoom rect
    QRect _zoomRect;

    //! indicates whether we're zooming in or out
    bool _isZoomOut;

    //! Flag to indicate a map canvas drag operation is taking place
    bool _dragging;

    RubberBand* _rubberBand;
};

}//MapControl
}//TGS
